{@
	$doc_srl = $oDocument->document_srl;

	$ds_nick = $ci['nick_name']->display == 'Y';
	$ds_user =	$ci['user_name']->display == 'Y';

	$un_extra = $oDocument->get('extra_vars');
	$un_extra = is_string($un_extra)?unserialize($un_extra):$un_extra;

	$my_point = $oThis->getPoint();
	$auction_status = (int) $oDocument->get('is_notice');
	$start_point = (int)$un_extra->beluxe->extra->start_point;
	$end_point = (int)$un_extra->beluxe->extra->end_point;
	$start_point>$end_point ? $start_point = 0 : 0;
	$end_time = ztime($oDocument->get('regdate'))+($un_extra->beluxe->extra->end_time*60*60);
	$complete_time = (int)$un_extra->beluxe->action->complete_time + 864000;

	$voted_list = $oThis->getDocumentVotedLogs($doc_srl);
	$is_voted = $grant->write_comment && $is_logged && $oDocument->isEnableComment() && $oDocument->allowComment();
	$is_voted && $oThis->member_srl ? $is_voted = $voted_list[$oThis->member_srl]->point : 0;

	$is_owner = $oThis->member_srl && $oDocument->get('member_srl') == $oThis->member_srl;
	$recover_pay_point = 5;
}

<!--@if(count($voted_list))-->
	{@
		reset($voted_list);
		$cur_voted = $auction_status?end($voted_list):current($voted_list);
	}
<!--@endif-->

<!--@if($grant->manager&&$auction_action==4)-->
	{@ $out = $oThis->setCustomStatus($doc_srl, 4)}
	<!--@if($out->toBool()&&$auction_status>0&&$cur_voted->point<0)-->
		{@ $ccPoint = &getController('point')}
		<!--@if($auction_status==3)-->
			{@
				$mbr_srl = $oDocument->get('member_srl');
				$mbr_srl?$ccPoint->setPoint($mbr_srl, abs($cur_voted->point), 'minus'):0;
				$mbr_srl?$my_point=($my_point - abs($cur_voted->point)):0;
			}
		<!--@endif-->
		{@
			$mbr_srl = $cur_voted->member_srl;
			$mbr_srl?$oThis->setVotePoint($doc_srl, $mbr_srl, abs($cur_voted->point)):0;
			$mbr_srl?$oThis->sendMessageToMember(0,$mbr_srl,$lang->msg_auction_canceled,sprintf($lang->msg_auction_point_recovery, abs($cur_voted->point), $oDocument->getPermanentUrl())):0;
			$oDocument->get('member_srl')?$oThis->sendMessageToMember(0,$oDocument->get('member_srl'),$lang->msg_auction_canceled,($auction_status==3?sprintf($lang->msg_auction_point_reduced, abs($cur_voted->point), $oDocument->getPermanentUrl()):$oDocument->getPermanentUrl())):0;
		}
	<!--@endif-->
	{@
		$out->toBool() ? $auction_status = 4 : 0;
		$out->toBool() ? $is_voted = abs($cur_voted->point) : 0;
	}
<!--@endif-->

<!--@if($auction_status < 3)-->
	<!--@if(!$auction_status && ((time() > $end_time)||($is_voted&&($end_point<=$is_voted))))-->
		{@
			$out = $oThis->setCustomStatus($doc_srl, ((int) $oDocument->getCommentCount()>0?1:3));
			$auction_status = $out->toBool()?1:0;
			$auction_status?$oThis->setCustomActions($doc_srl, array('complete_time',time())):0;
			$auction_status?$complete_time = time() + 864000:0;
		}
		<!--@if($auction_status && count($voted_list))-->
		{@
			$mbr_srl = $cur_voted->member_srl;
			$is_voted = abs($cur_voted->point)*-1;
			$mbr_srl?$oThis->setVotePoint($doc_srl, $mbr_srl, $is_voted):0;
			$mbr_srl?$oThis->sendMessageToMember($oDocument->get('member_srl'),$mbr_srl,$lang->msg_auctioned_off,sprintf($lang->msg_auction_send_phone, $un_extra->beluxe->extra->phone_number, $oDocument->getPermanentUrl())):0;
		}
		<!--@endif-->
	<!--@elseif($auction_status===1 && count($voted_list))-->
		<!--@if($oThis->member_srl && $auction_action==1)-->
		{@
			$tmp_action = $cur_voted->member_srl == $oThis->member_srl;
			$tmp_action ? $out = $oThis->setCustomStatus($doc_srl, 2) : 0;
			$auction_status= ($tmp_action&&$out->toBool()) ? 2 : 1;
			$mbr_srl = $oDocument->get('member_srl');
			$mbr_srl?$oThis->sendMessageToMember(0,$mbr_srl,$lang->cmd_transactions_verification,sprintf($lang->msg_transactions_verification, $oDocument->getPermanentUrl())):0;
		}
		<!--@elseif($complete_time&&time()>$complete_time)-->
		{@
			$out = $oThis->setCustomStatus($doc_srl, 2);
			$auction_status= $out->toBool() ? 2 : 1;
			$mbr_srl = $oDocument->get('member_srl');
			$mbr_srl?$oThis->sendMessageToMember(0,$mbr_srl,$lang->cmd_transactions_verification,sprintf($lang->msg_transactions_verification, $oDocument->getPermanentUrl())):0;
		}
		<!--@endif-->
	<!--@elseif($is_owner && $auction_status==2 && $auction_action==2 && count($voted_list))-->
		{@
			$out = $oThis->setCustomStatus($doc_srl, 3);
			$auction_status = $out->toBool() ? 3 : 2;
		}
		<!--@if($out->toBool()&&$cur_voted->point<0)-->
		{@
			$ccPoint = &getController('point');
			$mbr_srl = $oDocument->get('member_srl');
			$mbr_srl?$ccPoint->setPoint($mbr_srl, abs($cur_voted->point), 'add'):0;
			$mbr_srl?$my_point=($my_point + abs($cur_voted->point)):0;
		}
		<!--@endif-->
	<!--@endif-->
<!--@endif-->

<div class="hx h2">
	<h2><a href="{$oEntry->getUrl('','vid',$vid,'mid',$mid)}">{$mi->browser_title}</a>
	<block cond="$is_cts && $oDocument->get('category_srl')">
		&rsaquo; <a href="{$oEntry->getUrl('page','','act','dispBeluxeMobileCategory','')}">{$cts[$oDocument->get('category_srl')]->title}</a>
	</block>
	&rsaquo; {$oDocument->getTitle()}</h2>
	<a cond="$grant->write_document" href="{$oEntry->getUrl('act','dispBoardWrite','document_srl','')}" class="write">{$lang->cmd_write}</a>
</div>
<div class="hx pn">
	<span class="ex {$oDocument->get('member_srl')?'':'fsi'}">{cut_str((!$oDocument->get('member_srl')||$ds_nick||!$ds_user)?$oDocument->getNickName():$oDocument->getUserName(), $mi->nickname_length)}</span>
	<span class="ex">| {$oDocument->getRegdate()} |</span>
	<a href="#skip_co" class="ex">{$lang->skip_content}</a>
</div>

{@
	$is_granted = $oDocument->isGranted();
	$is_secret = $grant->view && $oDocument->isSecret();
	$is_locked = $is_cklok?$oThis->isLocked($doc_srl):0;
	$is_blind = $mi->use_blind=='Y'?$oThis->isBlind($doc_srl):0;
	$is_restrict = $mi->use_restrict_view!='N'&&!$is_granted&&!$is_secret?$oThis->isRestrict($doc_srl):0;

	$exks = ((!$is_secret || $is_granted) && $oDocument->isExtraVarsExists()) ? $oDocument->getExtraVars() : array();
	$tags = (!$is_secret || $is_granted) ? $oDocument->get('tag_list') : array();
	$ufls = ((!$is_secret || $is_granted) && $oDocument->hasUploadedFiles()) ? $oDocument->getUploadedFiles() : array();
}

<div class="co">
	<dl class="xv">
		<dt>{$lang->start_point}: {$start_point}</dt>
		<dt>{$lang->end_point}: {$end_point}</dt>
		<dt>{$lang->end_time}: {date('Y-m-d H:i:s',$end_time)}</dt>
	</dl>
	<dl cond="count($exks)" class="xv">
		<block loop="$exks=>$key,$val">
			<dt>{$val->name}</dt>
			<dd>{$val->getValueHTML()}</dd>
		</block>
	</dl>

	<div cond="$ds_mtlng&&count($un_extra->beluxe->langs)" class="scVlng">
		<a loop="$un_extra->beluxe->langs => $vlnc" href="#" onclick="doChangeLangType('{$vlnc}');return false;" class="{$vlnc}"><strong>{$lang_supported[$vlnc]}</strong></a>
	</div>

	<div class="doc {$is_blind?'blind':($is_secret?'secret':'')}">
		<form cond="$is_secret && !$is_granted" ruleset="checkPassword" action="./" method="post" class="ff secret">
			<input type="hidden" name="document_srl" value="{$doc_srl}" />
			<input type="hidden" name="act" value="procBoardVerificationPassword" />
			<input type="password" name="password" id="cpw" />
			<input type="submit" value="{$lang->cmd_input}" class="bn dark" />
		</form>

		<!--@if($is_restrict)-->
			<div id="restricted_view">
				<div class="msgArea">
					{sprintf(Context::getLang('msg_restricted_view'), 100)}
					<br />
					{Context::getLang($mi->use_restrict_view == 'P' ? 'msg_required_point' : 'msg_required_comment')}
				</div>
				{$oDocument->getSummary(100)}
				<div cond="$mi->use_restrict_view == 'P'" class="bna">
					<a class="bn dark" href="#" onclick="doCallModuleAction('beluxe','procBeluxePayPoint','{$doc_srl}');return false">
							{sprintf(Context::getLang('msg_point_is_used'), $un_extra->beluxe->use_point?$un_extra->beluxe->use_point:'0')}
					</a>
				</div>
			</div>
		<!--@else-->
			{$oDocument->getContent(false)}
		<!--@endif-->
	</div>
</div>

<div cond="$mi->document_bottom_text" class="co">
	{$mi->document_bottom_text}
</div>

<block cond="$is_logged">
	{@
		$ds_voteup = strpos($mi->use_vote, 'up')!==false;
		$ds_votedown = strpos($mi->use_vote, 'down')!==false;
		$ds_declare = strpos($mi->use_vote, 'declare')!==false;
		$adm_id = $ds_declare ? $oThis->getAdminId() : array();
	}
	<div cond="$ds_voteup||$ds_votedown||$ds_declare" class="bna">
		<a cond="$ds_voteup" class="bn white" style="color:#AA3300" href="#recommend" data-type="document" data-srl="{$doc_srl}" accesskey="z"><em class="vote">{$lang->short_voted_count}</em><em class="cnt">{$oDocument->get('voted_count')}</em></a>
		<a cond="$ds_votedown" class="bn white" style="color:#0000AA" href="#not_recommend" data-type="document" data-srl="{$doc_srl}" accesskey="x"><em class="blame">{$lang->short_blamed_count}</em><em class="cnt">{$oDocument->get('blamed_count')}</em></a>
		<a cond="$ds_declare" href="#declare" class="bn white" data-type="document" data-srl="{$doc_srl}" data-rec="{count($adm_id)?$adm_id[0]->member_srl:$oDocument->get('member_srl')}"><em class="declare">{$lang->cmd_declare}</em></a>
	</div>
</block>

<div cond="$tag_cnt = count($tags)" class="tags">
	<block loop="$i=0;$i<$tag_cnt;$i++"> {@ $tag = $tags[$i]}
		<span cond="$i">, </span><a href="{$oEntry->getUrl('', 'mid',$mid,'search_target','tag','search_keyword',$tag,'document_srl','')}" class="tag" rel="tag">{htmlspecialchars($tag)}</a>
	</block>
</div>

<div id="skip_co"></div>

<block cond="$mi->display_attached_files!='N'&&count($ufls)">
	<div class="hx h3">
		<h3>{$lang->uploaded_file} <em>[{count($ufls)}]</em><em cond="$mi->use_restrict_down=='P'" class="fr" style="letter-spacing:-1px">{sprintf($lang->msg_point_is_used, $un_extra->beluxe->use_point?$un_extra->beluxe->use_point:"0")} (Once)</em></h3>
		<button type="button" class="tg" title="open/close"></button>
	</div>
	{@
		$mi->display_attached_files?0:$mi->display_attached_files='Y';
		$ds_flsgn = $mi->display_attached_files=='Y'||$mi->display_attached_files=='G';
		$ds_flsmd = $mi->display_attached_files=='Y'||$mi->display_attached_files=='M';
	}
	<ul class="file tgo open">
		<li loop="$ufls=>$key,$file" cond="($ds_flsgn&&$file->direct_download!='Y')||($ds_flsmd&&$file->direct_download=='Y')" class="notvalid"|cond="$file->isvalid!='Y'" class="direct"|cond="$file->isvalid=='Y'&&$file->direct_download=='Y'">
			{@
				$t_down_pt = $mi->use_restrict_down == 'P' && (!$logged_info || $logged_info->member_srl != $file->member_srl);
				$t_down_pt = $t_down_pt && !$oThis->isDownloaded($file->file_srl) ? (int)$un_extra->beluxe->use_point : 0;
			}
			<a cond="!$file->file_size" href="{$file->isvalid=='Y'?$file->uploaded_filename:'#'}" target="_blank"|cond="$file->isvalid=='Y'">{$file->source_filename}<span class="size">(link)</span></a>
			<a cond="$file->file_size" href="{$file->isvalid=='Y'?getUrl('').$file->download_url:'#'}" class="isdownpt"|cond="$t_down_pt">{$file->source_filename}<span class="size">({$t_down_pt?'-$'.$t_down_pt.'/':''}{FileHandler::filesize($file->file_size)}/{number_format($file->download_count)})</span></a>
		</li>
	</ul>
</block>

<block cond="$oDocument->allowComment() || $oDocument->getCommentcount()">
{@
	$ocmt = $is_owner&&$auction_status ? $oThis->getCommentList($doc_srl, $cpage, $cmt_lstcnt) : $oThis->getCommentByMemberSrl($doc_srl);
	$cmts = isset($ocmt->data) ? $ocmt->data : $ocmt;
	$comment = count($cmts) ? current($cmts) : null;
	$is_recover = $auction_status || round(($end_time - time()) / 60) < 1 || $is_voted;
	$is_recover&&!$auction_status&&$comment&&($comment->get('member_srl')!=$logged_info->member_srl) ? $is_recover = false : 0;
}
	<form ruleset="insertComment"|cond="!$auction_status" action="./" method="post" class="inComfrm"|cond="!$is_recover">
	<input type="hidden" name="module_srl" value="{$mi->module_srl}" />
	<input type="hidden" name="document_srl" value="{$document_srl}" />
	<input type="hidden" name="nick_name" value="0" />
	<input type="hidden" name="password" value="0" />
	<input type="hidden" name="content" value="0" />
	<input cond="$comment->comment_srl" type="hidden" name="comment_srl" value="{$comment->comment_srl}" />
	<input cond="$is_logged" type="hidden" name="notify_message" value="Y" />
	<input cond="$is_recover" type="hidden" name="act" value="procBeluxeRecoverPoint" />
	<input cond="!$is_recover&&!$auction_status" type="hidden" name="act" value="procBoardInsertComment" />

	<div class="hx h3">
		<h3>
				{$lang->bidder} <em>{$oDocument->getCommentcount()}</em>
				<span cond="$is_logged" class="fr">
				<!--@if($is_recover)-->
					<!--@if($auction_status==4)-->
						<span cond="!$is_voted || $is_voted<0"><b>{$lang->msg_auction_canceled}</b></span>
						<button cond="!$is_owner&&$is_voted>0" type="submit">{$lang->cmd_recover_point} ({(int) $is_voted} - {$recover_pay_point})</button>
					<!--@elseif($is_owner)-->
						<span cond="$auction_status!=2" title="{$lang->verification_waiting_time}"|cond="$auction_status!=3"><b>{$auction_status==3?$lang->end_bid:date('Y-m-d H:i:s', $complete_time)}</b></span>
						<span cond="$auction_status==2" class="bn"><a href="{getUrl('auction_action','2')}" class="colGreen">{$lang->cmd_get_point} ({abs($cur_voted->point)})</a></span>
					<!--@else-->
						<span cond="$auction_status!==1&&(!$is_voted||$is_voted<0)"><b>{$lang->end_bid}</b></span>
						<span cond="$auction_status===1&&$is_voted<0" class="bn"><a href="{getUrl('auction_action','1')}" class="colGreen">{$lang->cmd_transactions_verification}</a></span>
						<button cond="$is_voted>0" type="submit">{$lang->cmd_recover_point} ({(int) $is_voted} - {$recover_pay_point})</button>
					<!--@endif-->
				<!--@elseif(!$is_owner)-->
					<input type="text" name="vote_point" data-min="{$start_point}" data-max="{$end_point}" style="width:100px" /><button type="submit" accesskey="s">{$lang->comment_write}</button>
				<!--@else-->
					Wait...
				<!--@endif-->
				</span>
				<span cond="!$is_logged" class="fr">
					<span class="bn"><a href="{$oEntry->getUrl('act','dispMemberLoginForm','auction_action','')}">{$lang->cmd_login}</a></span>
				</span>
		</h3>
	</div>

	</form>

	<ul cond="!count($cmts)" id="cl">
		<li>
			<!--@if(!$is_recover&&!$is_owner)-->
				<div>{sprintf($lang->about_comment_write, $recover_pay_point)}</div>
			<!--@elseif($is_recover&&$is_owner&&$auction_status===1)-->
				<div>{$lang->verification_waiting_time}</div>
			<!--@endif-->
				<div class="myp">{sprintf($lang->my_point,$my_point)}</div>
		</li>
	</ul>

	<ul cond="count($cmts)" id="cl">
		<li loop="$cmts=>$key,$comment"><a name="comment_{$comment->comment_srl}"></a>
			<div class="auth">
				<span class="fsi"|cond="!$comment->get('member_srl')">{cut_str((!$comment->get('member_srl')||$ds_nick||!$ds_user)?$comment->getNickName():$comment->getUserName(), $mi->nickname_length)}</span>
				<span class="time">| {zdate($comment->get('last_update'), "Y.m.d H:i:s")}</span>
			</div>
			<div>
				<!--@if($is_recover&&!$is_owner&&$auction_status===1&&$is_voted<0)-->
				{sprintf($lang->owner_info,$oDocument->get('nick_name'),$un_extra->beluxe->extra->phone_number,$oDocument->get('email_address'))}
				<div><a href="{getUrl('','module','communication','act','dispCommunicationSendMessage','receiver_srl',$oDocument->get('member_srl'))}" onclick="popopen(this.href,'popup'); return false;">{$lang->cmd_send_message}</a></div>
				<!--@elseif($is_recover&&!$is_owner&&!$auction_status&&$is_voted>0)-->
				<div>{sprintf($lang->about_cmd_recover_point, $recover_pay_point)}</div>
				<!--@elseif($is_recover&&!$is_owner&&$auction_status&&$is_voted>0)-->
				<div>{sprintf($lang->about_end_recover_point, $recover_pay_point)}</div>
				<!--@elseif(!$is_recover&&!$is_owner)-->
				<div>{sprintf($lang->about_comment_write, $recover_pay_point)}</div>
				<!--@endif-->
				<div class="myp">{sprintf($lang->my_point, (abs((int)$is_voted)).' / '.$my_point)}</div>
			</div>
		</li>
	</ul>

	<div cond="$ocmt->total_page > 1" id="clpn" class="pn">
		<a cond="$ocmt->page_navigation->cur_page != 1" href="{$oEntry->getUrl('comment_srl','','cpage',$ocmt->page_navigation->cur_page-1)}#comment" class="prev">{$lang->cmd_prev}</a>
		<strong id="curpage">{$ocmt->page_navigation->cur_page} / {$ocmt->page_navigation->last_page}</strong>
		<a cond="$ocmt->page_navigation->cur_page != $ocmt->page_navigation->last_page" href="{$oEntry->getUrl('comment_srl','','cpage',$ocmt->page_navigation->cur_page+1)}#comment" class="next">{$lang->cmd_next}</a>
	</div>
</block>

<div style="height:1px;overflow:hidden;background:#ddd"></div>
<div class="bna">
	<span class="fl">
		<a cond="$grant->manager&&$auction_status!=4" class="bn dark" style="margin-right:10px" href="{getUrl('auction_action','4')}" onclick="return confirm('{$lang->confirm_cancel_auction}')">{$lang->cmd_cancel_auction}</a>
	</span>
	<span class="fr">
		<a href="{$oEntry->getUrl('act', '','document_srl', '')}" class="bn white">{$lang->cmd_list}</a>
		<a cond="!$is_locked && $oDocument->isEditable()" href="{$oEntry->getUrl('act','dispBoardDelete','document_srl',$doc_srl,'comment_srl','')}" class="bn dark">{$lang->cmd_delete}</a>
	</span>
</div>